package com.etc.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 
 * @author cyf 前后台退出消除session
 *
 */
@Controller
@RequestMapping("outapi")
public class LoginOutController {
	@RequestMapping("loginout")
	public String loginout(HttpServletRequest request) {
		HttpSession  session= request.getSession();
		if(session.getAttribute("username")!=null) {
			session.invalidate();
		}
	
		return "redirect:/admin/views/login.jsp";
	}
	@RequestMapping("frontloginout")
	public String frontloginout(HttpServletRequest request) {
		HttpSession  session= request.getSession();
		if(session.getAttribute("username")!=null) {
			session.invalidate();
		}
	
		return "redirect:/index.jsp";
	}
}
